SynchronizedStack

Ecng.Collections

Represents a synchronized stack of items.

Erbt von: SynchronizedCollection<T, StackEx<T>>

Konstruktoren

SynchronizedStack
public SynchronizedStack()
synchronizedStack = SynchronizedStack()

Initializes a new instance of the SynchronizedStack class.

Methoden

Insert
public override void Insert(int index, T item)
synchronizedStack.Insert(index, item)

Throws a NotSupportedException as this operation is not supported for a stack.

index
The index at which the item should be inserted.
item
The item to insert.
OnGetItem
protected override T OnGetItem(int index)
result = synchronizedStack.OnGetItem(index)

Throws a NotSupportedException as this operation is not supported for a stack.

index
The index of the item to retrieve.

Rückgabe: This method always throws an exception.

OnIndexOf
protected override int OnIndexOf(T item)
result = synchronizedStack.OnIndexOf(item)

Throws a NotSupportedException as this operation is not supported for a stack.

item
The item to locate in the stack.

Rückgabe: This method always throws an exception.

OnInsert
protected override void OnInsert(int index, T item)
synchronizedStack.OnInsert(index, item)

Throws a NotSupportedException as this operation is not supported for a stack.

index
The index at which the item should be inserted.
item
The item to insert.
OnRemoveAt
protected override void OnRemoveAt(int index)
synchronizedStack.OnRemoveAt(index)

Throws a NotSupportedException as this operation is not supported for a stack.

index
The index of the item to remove.
Peek
public T Peek()
result = synchronizedStack.Peek()

Returns the object at the top of this stack without removing it.

Rückgabe: The item at the top.

Pop
public T Pop()
result = synchronizedStack.Pop()

Removes and returns the object at the top of this stack.

Rückgabe: The item removed from the top.

Push
public void Push(T item)
synchronizedStack.Push(item)

Adds an item to the top of this stack.

item
The item to add.